package com.big.order.listener;

import com.big.model.model.order.MerchandiseOrder;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MyOrderListener {



    //监听订单
    @RabbitListener(queues = "q.order",ackMode = "MANUAL")
    public void onMessage(MerchandiseOrder merchandiseOrder, Channel channel , Message message) throws Exception {
        channel.basicAck(message.getMessageProperties().getDeliveryTag() , false);
    }


}
